package com.dou.controller;

import com.dou.mapper.OrderDao;
import com.dou.pojo.order;
import com.dou.utils.Tools;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * Created with IntelliJ IDEA 2021.1 x64
 *
 * @Author: 窦义超
 * @Date: 2021/08/2021/8/14/19:04
 * @Description:
 */
@Controller
public class orderController {
@Autowired
    OrderDao orderDao;
    @RequestMapping("/toOrder")
    public String toOrder(Model model){
        List<order> orders = orderDao.selectAllByID(Tools.user_id);
        System.out.println(orders);
        model.addAttribute("orders",orders);
        return "order/order";
    }
}
